package com.weiling.mapper;

import com.weiling.entity.User;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Update;

import java.util.List;

@Mapper
public interface UserMapper {

    public List<User> selectAllUser();

    public User selectUserById(Integer id);

    @Insert("insert into user value (#{id},#{name},#{sex})")
    public int saveUser(User user);

    @Delete("delete from user where id = #{id}")
    public int deleteUserById(int user);

    @Update("update user set name = #{name}, sex = #{sex} where id = #{id}")
    public int updateUser(User user);
}
